const { Send } = require("../../utils/response");

module.exports = (req, res, next) => {
    const path = req.path.toLowerCase();
    if (path == "/users/login") {
        return next();
    }
    if (!req.session.user) {
        return Send(res, {
            code: 0,
            message: "请先登录"
        });
    }
    next();
};
